% model descriptions and basic calculations
%--------------------------------------------------------------------

% call environments and model selection
rsmodel_spec;

% check directories
retdir = chkdir(path_.root);
retdir = chkdir(path_.post);
retdir = chkdir(path_.result);


% parameter names
pnames = feval(fnames_.pnames,msel);

%--------------------------------------------------------------------
% prior specification
%--------------------------------------------------------------------
global prior_;
prior_ = feval(fnames_.prior,msel);

global mprior; 
global paraspec_;
paraspec_ = feval(fnames_.prtr,msel);


%--------------------------------------------------------------------
% data and parameters
%--------------------------------------------------------------------

% load data
loaddata;

sfile = [path_.post 'pm.mat'];
load(sfile);

x0 = invtrans(pmod); 
T = 2; R = 1000; 
[fh,xh]=sa('fncost',x0,T,R,data); 